package com.ydsungan.daoimpl;

import com.ydsungan.bean.Student;
import com.ydsungan.bean.Teacher;
import com.ydsungan.dao.TeacherDao;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;
import java.util.Map;

public class TeacherDaoImpl implements TeacherDao {


    SqlSessionFactory sqlSessionFactory = null;
    public TeacherDaoImpl(SqlSessionFactory sqlSessionFactory) {
        this.sqlSessionFactory = sqlSessionFactory;

    }

    @Override
    public Teacher findTeacherByMap(Map<String, Object> map) {
        SqlSession sqlSession = sqlSessionFactory.openSession();
        Teacher teacher = sqlSession.selectOne("findTeacherByMap", map);
        sqlSession.close();
        return teacher;
    }
}
